<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品管理</title>
</head>
<body>
	<h2 class="page-header" style="margin-top: 20px;">商品管理</h2>

	<!-- 搜索 -->
	<form action="#" style="margin-bottom: 10px;">

		<div class="row">
			<div class="col-sm-4 col-xs-4">
				<input type="text" class="form-control" placeholder="商品类型">
			</div>
			<div class="col-sm-4 col-xs-4">
				<input type="text" class="form-control" placeholder="发布人">
			</div>
			<div class="col-sm-4 col-xs-4">
				<button class="btn  btn-primary " type="submit">搜索</button>
			</div>
		</div>
	</form>
	<div class="table-responsive"  id="goods_detail_show">
		<table class="table table-striped">
			<thead>
				<tr>
					<th>序号</th>
					<th>商品名</th>
					<th>商品价格</th>
					<th>交易地点</th>
					<th>发布人</th>
					<th>联系方式</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>

			<tbody>
				<c:forEach items="${goods_lists}" var="goods" varStatus="status">
					<tr>
						<td>${status.index+1}</td>
						<td width="30%">${goods.goods_name}</td>
						<td>${goods.goods_price}</td>
						<td>${goods.trade_place}</td>
						<td>${goods.user.username}</td>
						<td>${goods.telephone}</td>
						<td>无</td>
						<td>
							<a
								onclick="value_g(${goods.goods_id},'${goods.goods_name}','${goods.goods_price}',${goods.goods_show_admin})"
										data-toggle="modal" data-target="#GoodsModal">修改</a>

							<a onclick="delete_g(${goods.goods_id})" >删除</a>
						</td>
					</tr>
				</c:forEach>

			</tbody>

		</table>
	</div>

	<!-- 模态框（Modal） -->
	<div class="modal fade" id="GoodsModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
					</button>
					<h4 class="modal-title" id="myModalLabel">
						商品信息修改
					</h4>
				</div>
				<div class="modal-body">
					<input type="hidden" id="gid" name="gid" value="">



					<div class="form-group">
						<label>商品名</label>
						<input type="text" name="name" class="form-control" id="name" value="" maxlength="20">
					</div>

					<div class="form-group">
						<label>商品价格</label>
						<input type="number" min="0" max="9999" name="price" class="form-control" id="price" placeholder="商品价格" >
					</div>

					<%--<form id="showlist">--%>
						<div class="form-group">
							<label >设置为主页商品：</label>
							<select id="show_option">
								<option value="1">是</option>
								<option value="0">否</option>
							</select>
						</div>
					<%--</form>--%>


				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">
						关闭
					</button>
					<button type="button" class="btn btn-primary" onclick="goodsModify()">
						提交更改
					</button>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->

<p id="test">test</p>
	<script src="/market/js/common.js"></script>
</body>
</html>